package com.belinked_client.client_friend;

import com.client.R;

import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import android.view.GestureDetector;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
public class chat_main_layout extends RelativeLayout implements GestureDetector.OnGestureListener{  
    
    private int edittext_hight;
    private Context mContext;  
    public chat_main_layout(Context context,ScrollView mScrollView,
    		EditText mEditText,ImageButton mButton,int wight,int hight) {
		super(context);
		Log.d("!!!!!room_chat_main_layout", "wight + hight "+wight+" "+hight);
		edittext_hight = 50;
		// TODO Auto-generated constructor stub
	   this.mContext =context;
	   LayoutParams lp=new LayoutParams(wight,hight); 
	   this.setLayoutParams(lp);
	   mScrollView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
	   RelativeLayout.LayoutParams lp_text = new RelativeLayout.LayoutParams(wight,
				hight-edittext_hight);
	   lp_text.topMargin = 0;
	   lp_text.leftMargin = 0;
	   this.addView(mScrollView,lp_text);
	   RelativeLayout.LayoutParams lp_edittext = new RelativeLayout.LayoutParams((int)(wight*0.75),
			   edittext_hight);
	   lp_edittext.topMargin = hight- edittext_hight;
	   lp_edittext.leftMargin = 0;
	   this.addView(mEditText,lp_edittext);
	   mEditText.setGravity(Gravity.BOTTOM);
	   RelativeLayout.LayoutParams lp_button = new RelativeLayout.LayoutParams((int)(wight*0.25),
				edittext_hight);
	   
	   lp_button.topMargin = hight- edittext_hight;
	   lp_button.leftMargin =(int)(wight*0.75);
	   
	   this.addView(mButton,lp_button);
    }
    

	public interface PanelClosedEvent {  
        void onPanelClosed(View panel);  
    }  
      
    public interface PanelOpenedEvent {  
        void onPanelOpened(View panel);  
    }  
	@Override
	public boolean onDown(MotionEvent arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean onFling(MotionEvent arg0, MotionEvent arg1, float arg2,
			float arg3) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void onLongPress(MotionEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
			float distanceY) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void onShowPress(MotionEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean onSingleTapUp(MotionEvent e) {
		// TODO Auto-generated method stub
		return false;
	}  
}